#! /bin/bash

sleep $(($RANDOM%50))

# Just wait backend is up.
for i in {0..9};do
    curl backend.dubhe-system.svc.cluster.local
    if [ $? = "0" ];then
        echo "backend is initialized"
        exit 0
    fi
    echo "backend service is not initialized, waiting 10s..."
    sleep 10
done

exit 1
